package com.bms.hystrix.interfaces.kyjlgl;

import com.bms.hystrix.pojo.ChuFangGuanLiChanXun;
import com.bms.hystrix.pojo.FeiYongGuanLiChanXun;
import com.bms.hystrix.pojo.FeiYongGuanLiZhengJia;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Map;

// 此接口与feign中定义的接口一样，直接迁移过来即可
// 调用一个子服务模块，需要在注解中指定，名字由client的yml文件定义
@FeignClient(value = "EUREKA-CLIENT-KYJLGL")
public interface FeiYongGuanLiInterface {
    @RequestMapping(value = "/feiYongGuanLi/chaXunFenYe",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> chaXunFenYe(@RequestParam(value = "feiYongGuanLiChanXun") FeiYongGuanLiChanXun feiYongGuanLiChanXun);

    @RequestMapping(value = "/feiYongGuanLi/xinZengXiangMuJingFei",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> xinZengXiangMuJingFei(@RequestParam(value = "feiYongGuanLiZhengJia") FeiYongGuanLiZhengJia feiYongGuanLiZhengJia);

    @RequestMapping(value = "/feiYongGuanLi/xinZengHeZuoJingFei",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> xinZengHeZuoJingFei(@RequestParam(value = "feiYongGuanLiZhengJia") FeiYongGuanLiZhengJia feiYongGuanLiZhengJia);

    @RequestMapping(value = "/feiYongGuanLi/xinZengChuLaiJingFei",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> xinZengChuLaiJingFei(@RequestParam(value = "zhuangTai") String zhuangTai, @RequestParam(value = "feiYongGuanLiZhengJia") FeiYongGuanLiZhengJia feiYongGuanLiZhengJia);


    @RequestMapping(value = "/feiYongGuanLi/gengXinShenHeById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> gengXinShenHeById(@RequestParam(value = "id") int id,
                                          @RequestParam(value = "zhuangTai") String zhuangTai,
                                          @RequestParam(value = "guanLiYuanPiZhu", required = false) String guanLiYuanPiZhu);


    @RequestMapping(value = "/feiYongGuanLi/gengXinBoKuanById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> gengXinBoKuanById(@RequestParam(value = "id") int id,
                                          @RequestParam(value = "boKuanZhuangTai") @Pattern(regexp = "已拨款|未拨款|拨款中", message = "已拨款 或 未拨款 或 拨款中") @Size(min = 0, max = 3, message = "状态在0-3个字符") String boKuanZhuangTai,
                                          @RequestParam(value = "guanLiYuanPiZhu", required = false) @Size(min = 0, max = 25, message = "管理员批注必须在0~25位之间") String guanLiYuanPiZhu);


    @RequestMapping(value = "/feiYongGuanLi/shanChu",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> shanChuById(@RequestParam(value = "id") int id);

}

